perf(stark): hoist query-invariant deep-composition sums out of the FRI query loop#776
Open
Oppen wants to merge 1 commit into
Open
perf(stark): hoist query-invariant deep-composition sums out of the FRI query loop#776Oppen wants to merge 1 commit into
Oppen wants to merge 1 commit into
Conversation
…RI query loop reconstruct_deep_composition_poly_evaluation_pair recomputed ood_row_sum, z_pow, and h_sum_zpow from scratch on every one of the ~80 FRI queries per proof, even though they depend only on challenges and proof-level OOD data. Compute them once per proof in compute_query_invariant_deep_terms and reuse across queries, removing the O(num_queries * height * width) coeff * ood multiplies. Derive number_of_parts from proof.composition_poly_parts_ood_evaluation.len() (validated once against the AIR's degree bound) instead of each query's own opening length, and check both openings against that fixed value per query — strictly stronger than the previous regular-vs-symmetric-only guard, since it also rejects a proof whose per-query opening length varies query to query.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
challengesand proof-level OOD/gamma data (ood_row_sum,number_of_parts,z_pow,h_sum_zpow) out of the per-queryreconstruct_deep_composition_poly_evaluation_pairinto a new once-per-proofcompute_query_invariant_deep_terms, eliminating the O(num_queries × height × width)coeff * oodmultiplies down to O(height × width).number_of_partsfromproof.composition_poly_parts_ood_evaluation.len()(already validated against the AIR's degree bound inmulti_verify_archived) instead of each query's own opening length, and check both regular/symmetric per-query openings against that fixed value — strictly stronger than the previous regular-vs-symmetric-only guard, since it also rejects a proof whose per-query opening length varies query to query.Numbers
step3:fristep3:friTest plan
cargo check -p starkcargo test -p stark(137 tests pass)make test-ethrexcargo test -p lambda-vm-prover --lib test_recursion_execute_1query -- --ignored --nocapture(in-VM verify accepted)make test-profile-recursion-single/make test-profile-recursion-multi(cycle counts above)number_of_partsguard change is a genuine strengthening, and hoisted sums are algebraically identical to the per-query-recomputed values for honest proofs